package com.mzy.datepackage.M2022.Apr.twFour;

import org.springframework.util.StringUtils;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/4/24 14:35
 * @Version 1.0
 */
public class test {
    public static void main(String[] args) {
        split(",");
        splitError(",");
    }

    public static void splitError(String str) {
        if (StringUtils.isEmpty(str)) {
            return;
        }
        String[] part = str.split(",");
            String s0 = part[0];
            System.out.println(s0);
        }

    public static void split(String str) {
        if (StringUtils.isEmpty(str)) {
            return;
        }
        String[] part = str.split(",");

        if (part.length == 1) {
            String s0 = part[0];
            System.out.println(s0);
        } else if (part.length > 1) {
            String s0 = part[0];
            System.out.println(s0);
            String s1 = part[1];
            System.out.println(s1);
        }
    }
}
